package cn.lixu.basic.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class JsonResult {
    private Boolean success = true;
    private String msg = "操作成功";

   //传参使用
    private Object resultObj;


    public static JsonResult me() {
        return new JsonResult();
    }

    public JsonResult setMsg(String msg) {
        this.success = false;
        this.msg = msg;
        return this;
    }

    //将path封装到jsonResult
    public JsonResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}

